﻿<UserControl x:Class="Anagramme.Views.HomeView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:resx="clr-namespace:Anagramme.Resources"
             mc:Ignorable="d" 
             d:DataContext="{d:DesignData Source=/SampleData/HomeViewModelSampleData.xaml}"
             d:DesignHeight="700" d:DesignWidth="400">
    <Grid>
    	<Grid.RowDefinitions>
    		<RowDefinition Height="Auto"/>
    		<RowDefinition Height="Auto"/>
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
    	<Grid.ColumnDefinitions>
    		<ColumnDefinition/>
    		<ColumnDefinition Width="Auto" />
    	</Grid.ColumnDefinitions>
        <TextBlock Margin="12,12,0,0" Style="{DynamicResource Titre}" 
		           Text="{Binding Path=Home.TITLE, Source={StaticResource ResourceKey=Resources}}" />
        <StackPanel Margin="12,10,0,0" VerticalAlignment="Top" d:LayoutOverrides="Width" Grid.Row="1" HorizontalAlignment="Left" >
            <Button HorizontalAlignment="Left" 
                    Content="{Binding Path=Home.CREATE, Source={StaticResource ResourceKey=Resources}}"
                    Command="{Binding Path=CreateGameCommand, Mode=OneTime}" Style="{DynamicResource Button}" />
            <TextBlock Margin="0,5,0,0" TextWrapping="Wrap"
                       Text="{Binding Path=Home.CREATEDESCRIPTION, Source={StaticResource ResourceKey=Resources}}" Style="{DynamicResource Texte}" />
            <Button Margin="0,12,0,0" HorizontalAlignment="Left" 
                    Content="{Binding Path=Home.JOIN, Source={StaticResource ResourceKey=Resources}}"
                    Command="{Binding Path=JoinGameCommand, Mode=OneTime}" Style="{DynamicResource Button}" />
            <TextBlock Margin="0,5,0,0" TextWrapping="Wrap"
                       Text="{Binding Path=Home.JOINDESCRIPTION, Source={StaticResource ResourceKey=Resources}}" Style="{DynamicResource Texte}" />
        </StackPanel>
        <StackPanel Margin="12,72,0,0" VerticalAlignment="Top" Grid.Row="2" HorizontalAlignment="Left" >
            <TextBlock Text="{Binding Path=Home.OPTIONS, Source={StaticResource ResourceKey=Resources}}" Style="{DynamicResource SousTitre}" />
            <StackPanel Margin="0,5,0,0" Orientation="Horizontal">
                <TextBlock Text="{Binding Path=Home.PLAYERNAME, Source={StaticResource ResourceKey=Resources}}" VerticalAlignment="Center" Style="{DynamicResource Texte}" />
                <TextBox x:Name="txtPlayerName" Margin="5,0,0,0" Width="150" HorizontalAlignment="Right"
                         Text="{Binding Path=PlayerName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" 
                         Style="{DynamicResource TextBox}" />
                <Button Margin="5,0,0,0"
                        Content="{Binding Path=Home.SAVEOPTIONS, Source={StaticResource ResourceKey=Resources}}"
                        Command="{Binding Path=SaveOptionsCommand, Mode=OneTime}" Style="{DynamicResource Button}" IsDefault="True" />
            </StackPanel>
        </StackPanel>
        <Button Grid.Row="3" Margin="0,0,12,12" HorizontalAlignment="Right" VerticalAlignment="Bottom"
                Content="{Binding Path=Home.EXIT, Source={StaticResource ResourceKey=Resources}}"
                Command="{Binding Path=ExitCommand, Mode=OneTime}" Style="{DynamicResource Button}" IsCancel="True" />
    </Grid>
</UserControl>
